package com.baidu.health.mapper;

import com.baidu.health.pojo.TbCase;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Entity com.baidu.health.pojo.TbCase
 */
@Mapper
public interface TbCaseMapper extends BaseMapper<TbCase> {

    @Select("select * from tb_case where ask_diseaser=#{askDiseaser}")
    List<TbCase> caseByackDiseaser(Integer askDiseaser);
    @Update("update from set case_deleted=0 where case_id=#{cid}")
    void updateBystate(Integer cid);
    @Update("update tb_case set deleted=0 where case_id=#{caseId}")
    void updateByCaseId(Integer caseId);

    @Select("select case_id from tb_case where case_name=#{caseName}")
    Integer selectByName(String caseName);

    @Select("select * from tb_case where case_starttime >=#{es}")
    List<TbCase> selectByTime(String es);
}




